#include "BieuThucTong.h"


BieuThucTong::BieuThucTong(void):BieuThuc()
{
}

BieuThucTong::BieuThucTong(BieuThuc* bieuthuc1,BieuThuc* bieuthuc2)
{
	
	this->m_pBieuThuc = bieuthuc1;
	this->m_pNext = bieuthuc2;
}

BieuThuc* BieuThucTong::daoHam()
{
	BieuThuc *bieuthuc1;
	bieuthuc1  = this->m_pBieuThuc->daoHam();
	BieuThuc *ketqua;

	if(this->m_pNext!=NULL)
	{
		BieuThuc *bieuthuc2;
		bieuthuc2 = this->m_pBieuThuc->daoHam();
		ketqua = new BieuThucTong(bieuthuc1,bieuthuc2);
	}
	else
	{
		ketqua = new BieuThuc(*bieuthuc1);
	}

	return ketqua;
}
BieuThucTong::~BieuThucTong(void)
{
	delete [] this->m_pBieuThuc;
	delete [] this->m_pNext;
}
